package com.haizhi.messagehub.template;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import com.haizhi.messagehub.config.annotation.MessageHub;

@Slf4j
@Service
public class RedisConsumerTemplate {

    @MessageHub(topic = "uptown_test", type = "REDIS_PUBSUB")
    public void consumer(Object message, String pattern) {

        log.info("topic {} received {} ", pattern, message);
    }

    @MessageHub(topic = "uptown_queue", type = "REDIS_QUEUE")
    public void redisQueue(String message) {
        log.info("queue info {}", message);
    }

    @MessageHub(topic = "uptown_stream", group = "uptown-group", type = "REDIS_STREAM")
    public void redisStream(String message) {

        log.info("stream info {}", message);
    }
}
